home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
MENU.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
1KB
|
33 lines
' MENU.BAS
' This program demonstrates the LEN function.
missMuffet$ = "Curds and Whey" ' declare meal strings
simpleSimon$ = "Pie du Jour"
petersPlate$ = "Pumpkin Surprise"
CLS
PRINT "Which meal would you enjoy?" ' display meal prompt
PRINT
PRINT missMuffet$ ' display meal choices
PRINT simpleSimon$
PRINT petersPlate$
PRINT
INPUT "Selection: ", choice$ ' get meal choice from user
choice$ = UCASE$(choice$) ' convert string to uppercase
PRINT
SELECT CASE choice$ ' find variable that matches
CASE IS = UCASE$(missMuffet$) ' meal entered and print length
PRINT missMuffet$; " is"; LEN(missMuffet$); "characters long"
CASE IS = UCASE$(simpleSimon$)
PRINT simpleSimon$; " is"; LEN(simpleSimon$); "characters long"
CASE IS = UCASE$(petersPlate$)
PRINT petersPlate$; " is"; LEN(petersPlate$); "characters long"
CASE ELSE ' print message if no match found
PRINT "I don't recognize that meal!"
END SELECT